<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div>
    <h1>The Ajax 03 Page</h1>
    <button onclick="doAjaxGet()">Do Ajax Get</button>
    <button onclick="doAjaxPost()">Do Ajax Post</button>
    <button onclick="doAjaxPostJson()">Do Ajax Post Json</button>
    <button onclick="doAjaxDelete()">Do Ajax Delete</button>
    <button onclick="doAjaxPut()">Do Ajax Put</button>
</div>
<div id="result"></div>
<script src="/js/ajax.js"></script>
<script>
    //ajax get request
    function doAjaxGet(){
        const url="/doAjaxGet";
        const params="";
        ajaxGet(url,params,function(result){
            document.querySelector("#result").innerHTML=result;
        })
    }

    function doAjaxPost(){
        const url="/doAjaxPost";
        const params="id=101&name=Computer&remark=Computer...";
        ajaxPost(url,params,function(result){
            document.querySelector("#result").innerHTML=result;
        })
    }
</script>
</body>
</html>